package priv.pront.code.mati.national.practice;

import java.util.Scanner;

/**
 * @Author: Pronting
 * @Description: TODO
 * @DateTime: 2023/12/1 12:56
 **/
public class P5723_质数口袋 {

    static int n, size = 0;
    static int INF = (int) 1e9;
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        n = scanner.nextInt();
        for (int i = 2; i < INF; i++) {
            if(check(i)) System.out.println(i);
        }
        System.out.println(size);

    }

    private static boolean check(int num){
        if(n - num < 0) return false;
        for (int i = 2; i * i <= num; i++) {
            if(num % i == 0) return false;
        }
        n -= num;
        size++;
        return true;
    }
}
